package Terminal.View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import Terminal.View.Gestori.GestoreInterfaccia;

public class JBottoniTimeRecordModifica extends JBottoniTimeRecord{

	private JButton nuovoTimerecord;
	private JButton salvamodifica;
	private JButton annullamodifica;
	@Override
	public void createComponents() {
		this.setBounds(20, 601, 1280, 80);
		this.setLayout(null);
		setBottoni();
	//	this.setBackground(Color.WHITE);
		add(nuovoTimerecord);
		add(salvamodifica);
		add(annullamodifica);
		setVisible(true);
	}
	
	private void setBottoni(){
		nuovoTimerecord = new JButton("Nuovo TimeRecord");
		nuovoTimerecord.setBounds(200,15,150,50);//100, 30,nuovoTimerecord.getPreferredSize().width,30);
		nuovoTimerecord.setEnabled(false);
		
		salvamodifica = new JButton("Salva modifica");
		salvamodifica.setBounds(1130,15,150,50);//900, 30,salvamodifica.getPreferredSize().width,30);
		salvamodifica.addActionListener(new ActionListener() {
					
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mediator.smista("GestireTimeRecord", "SalvaModificaTimeRecord");				
			}
		});
		
		annullamodifica = new JButton("Annulla");
		annullamodifica.setBounds(970,15,150,50);//1100, 30,annullamodifica.getPreferredSize().width,30);
		annullamodifica.addActionListener(new ActionListener() {
					
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mediator.smista("GestireTimeRecord", "VisualizzaTimeRecord");				
			}
		});
		
	}

}
